<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="/static/index/css/swiper-3.4.2.min.css">
    <link rel="stylesheet" href="/static/index/css/GL.css">
    <script src="/static/index/js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>

    <script src="/static/index/js/swiper-3.4.2.jquery.min.js" type="text/javascript" charset="utf-8"></script>

    <script src="/static/index/js/swiper-3.4.2.min.js"></script>

</head>

<body>
<div class="top_find">
    <div class="top_find_son">
        <img src="/static/index/img/top_find_logo.png" alt="">
        <div class="input_find">
            <input type="text" placeholder="卸妆水"/>
            <span style="background: url(/static/index/img/img_12.png) 0 -1px;"></span>
            <a href="/static#"><img src="/static/index/img/img_09.png"/></a>
        </div>
    </div>
</div>
<ul class="left_floor">
    <li class="left_floor_xiang">享品质</li>
    <li class="left_floor_fu">服饰美妆</li>
    <li class="left_floor_jia">家电手机</li>
    <li class="left_floor_dian">电脑数码</li>
    <li class="left_floor_3C">3C运动</li>
    <li class="left_floor_ai">爱吃</li>
    <li class="left_floor_mu">母婴家居</li>
    <li class="left_floor_tu">图书汽车</li>
    <li class="left_floor_you">游戏金融</li>
    <li class="left_floor_lv">旅行健康</li>
    <li class="left_floor_hai">还没逛够</li>
    <li class="left_floor_ding">顶部</li>
</ul>
<header>
    <div class="head">
        <a href="http://www.drygoods.top"><img src="/static/index/img/img_01.png"/></a>
        <p>X</p>
    </div>
    <!--头部-->
    <div class="header_head">
        <div class="header_head_box">
            <ul>
                <li>
                    <a href="http://www.drygoods.top" class="header_head_p_a1" style="width:73px;">
                        drygoods首页
                    </a>
                    <a th:if="${session.loginUser!=null}">
                        欢迎：[[${(session.loginUser!=null)?session.loginUser.username:''}]]
                    </a>
                    <a th:if="${session.loginUser==null}" href="http://auth.drygoods.top/login.html">
                        您好，请登录
                    </a>
                </li>
                <li>
                    <a th:if="${session.loginUser==null}" href="http://auth.drygoods.top/reg.html" class="li_2">
                        免费注册
                    </a>
                </li>
                <span>|</span>
                <li>
                    <a href="http://member.drygoods.top/orderList.html">我的订单</a>
                </li>


            </ul>
        </div>
    </div>
    <!--评论主体-->
    <div style="width: 1210px;margin: 0 auto;">
        <div style="font:12px/1.5 tahoma,arial,\5b8b\4f53;-webkit-font-smoothing: antialiased;color: #E3E4E5;">
            <!--订单号-->
            <div oid="241892961162" style="width: 100%;text-align: center;">
                <div style="padding: 15px 0;">
                    <h3 style="font: italic 700 16px/20px 'Microsoft YaHei' ;color: #333;">评价</h3>
                    <div style="font: 12px/22px verdana;color: #999;">
                        <span style="margin-right: 20px;">订单号：
                            <a href="#none" th:text="${orderSn}">241892961162</a></span>
                    </div>
                </div>
            </div>
            <!--商品基本信息和sku信息-->
            <div style="width: 100%;overflow: hidden;">
                <div>
                    <!--  /widget/comment-form/comment-form.vm -->
                    <div style="border-top: 1px solid #e4e4e4;margin-top: -1px;margin-bottom: 1px;overflow: hidden;background: #fff;font-family: verdana,'5b8b/4f53;';">
                        <div style="float: left;width: 322px;">
                            <div style="padding: 55px 50px;">
                                <div style="width: 100%;height: 100px;margin-bottom: 15px;text-align: center;overflow: hidden;">
                                    <a th:href="'http://item.drygoods.top/'+${spuComment.skuId}+'.html'">
                                        <img style="width: 100px;height: 100px;"
                                             th:src="${spuComment.skuPic}"
                                             alt="">
                                    </a>
                                </div>
                                <div class="p-name"
                                     style="width: 100%;line-height: 20px;margin-bottom: 10px;text-align: center;overflow: hidden;">
                                    <a th:href="'http://item.drygoods.top/'+${spuComment.skuId}+'.html'">
                                        [[${spuComment.spuName}]]
                                    </a><br>
                                    <span style="color: black"
                                          th:each="skuAttr:${spuComment.skuAttrs}">[[${skuAttr}]]<br></span>
                                </div>
                            </div>
                        </div>
                        <div class="fi-operate"
                             style="overflow: hidden;zoom: 1;border-left: 1px solid #f5f5f5;padding: 30px 40px 0;padding-bottom: 4000px;margin-bottom: -4000px;position: relative;z-index: 1;">
                            <div style="padding: 0 40px;">
                                <div style="line-height: 30px;margin-bottom: 10px;color: #999;"></div>
                                <div style="margin-bottom: 12px;">
                                    <span>
                                            <span><i></i></span>
                                            <span><i></i></span>
                                            <span><i></i></span>
                                            <span><i></i></span>
                                            <span><i></i></span>
                                        <input id="star" type="text" placeholder="1-5"
                                               style="width: 40px"/><span
                                            style="color: red">星</span>
                                        <div id="starMsg" style="color: red;display: none">请输入1-5颗星!</div>
                                    </span>
                                </div>
                                <!--                                <div style="line-height: 20px;margin-bottom: 10px;color: #333;">-->
                                <!--                                    您没有填写评价内容-->
                                <!--                                </div>-->
                                <div style="width: 100%;margin-bottom: 20px;overflow: hidden;">
                                </div>
                                <div>
                                    <div style="float: left;width: 100%;padding-bottom: 25px;">
                                        <div style="padding: 10px 10px 0; border: 1px solid #e0e0e0; margin-bottom: 10px; overflow: hidden;">
                                                <textarea id="content" placeholder="写写你的感受吧~"
                                                          style="width: 100%;height: 54px;max-width: 100%;max-height: 54px;min-height: 54px;line-height: 18px;border: medium none;color: #333;resize: vertical;resize: none;font-size: 12px;"></textarea>
                                            <div style="height: 30px;line-height: 30px;text-align: right;color: #999;">
                                                <!--                                                <em class="textarea-num">可输入500字</em>-->
                                            </div>
                                        </div>
                                        <div style="float: left;width: 100%;">
                                            <div style="position: relative;width: 100%;overflow: hidden;margin-bottom: 10px;">
                                                <input type="file" name="file" id="input_file" multiple="multiple"
                                                       accept="image/gif,image/jpeg,image/jpg,image/png,image/svg"
                                                >
                                            </div>
                                        </div>
                                        <div><i></i><em></em></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--/ /widget/comment-form/comment-form.vm -->
                </div>

            </div>
        </div>
    </div>

    <!--其他一些无需显示但需要传递的数据-->
    <input type="hidden" id="commentType" th:value="'0'"/>

    <!--发布按钮-->
    <div style="position: relative;width: 100%;height: 48px;padding: 30px 0;text-align: center;
                                                    background-color: #fff;margin-top: 50px;margin-bottom: 40px;">
        <button onclick="imgPreview()"
                style="width: 220px;height: 48px;line-height: 48px;padding: 0;font-family: 'Microsoft YaHei';
                                                                font-size: 18px;display: inline-block;text-align: center;cursor: pointer;color: #fff;
                                                               border-radius: 3px;background-color: #df3033;">
            发布
        </button>

    </div>
</header>

<div class="section_second">
    <!-- 第一层 -->
    <div style="padding-bottom: 18px;background: #eaeaea;overflow: hidden;margin-top: 10px">
        <p class="section_second_header_img"></p>
        <li style="width: 247px;float: left;margin-left: 127px">
            <div style="position: relative;margin: 0 auto;padding-left: 45px; width: 180px;">
                <p style="overflow: hidden;
                width: 100%;
                height: 42px;
                line-height: 42px;font-size: 18px;
                font-weight: 700;
                text-overflow: ellipsis;
                white-space: nowrap;
                margin-top: 15px;
                color: #444;">
                    品类齐全，轻松购物</p>
            </div>
        </li>
        <li style="width: 247px;float: left;margin-left: 90px;">
            <div style="position: relative;margin: 0 auto;padding-left: 45px; width: 180px;">
                <p style="overflow: hidden;
                width: 100%;
                height: 42px;
                line-height: 42px;font-size: 18px;
                font-weight: 700;
                text-overflow: ellipsis;
                white-space: nowrap;
                margin-top: 15px;
                color: #444;">
                    多仓直发，极速配送</p>
            </div>
        </li>
        <li style="width: 247px;float: left;margin-left: 90px;">
            <div style="position: relative;margin: 0 auto;padding-left: 45px; width: 180px;">
                <p style="overflow: hidden;
                width: 100%;
                height: 42px;
                line-height: 42px;font-size: 18px;
                font-weight: 700;
                text-overflow: ellipsis;
                white-space: nowrap;
                margin-top: 15px;
                color: #444;">
                    正品好货，精致服务</p>
            </div>
        </li>
        <li style="width: 247px;float: left;margin-left: 90px;">
            <div style="position: relative;margin: 0 auto;padding-left: 45px; width: 180px;">
                <p style="overflow: hidden;
                width: 100%;
                height: 42px;
                line-height: 42px;font-size: 18px;
                font-weight: 700;
                text-overflow: ellipsis;
                white-space: nowrap;
                margin-top: 15px;
                color: #444;">
                    天天低价，畅选无忧</p>
            </div>
        </li>
        <br/><br><br>
        <p style="border-bottom: solid 1px #dedede;margin-bottom: 10px"></p>
        <div class="w" style="width: 1210px;text-align: center;margin-left: 165px;">
            <div class="copyright_links" style="margin: 0;padding: 0;">
                <p>
                    <a href="//about.jd.com"
                       target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">关于我们</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//about.jd.com/contact/"
                       target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">联系我们</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//help.jd.com/user/custom.html" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">联系客服</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//lai.jd.com" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">合作招商</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//helpcenter.jd.com/venderportal/index.html" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">商家帮助</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//jzt.jd.com" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">营销中心</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//app.jd.com/" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">手机京东</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//club.jd.com/links.aspx" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">友情链接</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//media.jd.com/" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">销售联盟</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//pro.jd.com/mall/active/3WA2zN8wkwc9fL9TxAJXHh5Nj79u/index.html"
                       target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">京东社区</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//pro.jd.com/mall/active/3TF25tMdrnURET8Ez1cW9hzfg3Jt/index.html"
                       target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">风险监测</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//about.jd.com/privacy/" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">隐私政策</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//gongyi.jd.com" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">京东公益</a><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//www.joybuy.com/" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">English
                        Site</a><span style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//corporate.jd.com/" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">Media
                        &amp; IR</a>
                </p>
            </div>
            <div class="copyright_info">
                <p>
                    <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11000002000088"
                       target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">京公网安备
                        11000002000088号</a><span style="margin: 0 6px;color: #ccc;">|</span><span><a
                        href="http://beian.miit.gov.cn"
                        target="_blank"
                        style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">京ICP备11041704号</a></span><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//h5.m.jd.com/pc/dev/3T3No18XR8k8rpLGLGhgbJ1StAFq/index.html" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;"
                       rel="noopener noreferrer">ICP</a><span style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//jdwp.jd.com/544-2927.html"
                       target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">互联网药品信息服务资格证编号(京)-经营性-2014-0008</a><span
                        style="margin: 0 6px;color: #ccc;">|</span><span
                        style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">新出发京零 字第大120007号</span>
                </p>
                <p><span style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">互联网出版许可证编号新出网证(京)字150号</span><span
                        style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//pro.jd.com/mall/active/3bVDLXHdwVmdQksGF8TtS7ocq1NY/index.html"
                       target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">出版物经营许可证</a><span
                            style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//img10.360buyimg.com/ling/jfs/t1/164806/19/5070/567736/6017d6d6Eab06ec9c/d8ca6e029f495447.jpg"
                       target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">网络文化经营许可证京网文[2020]6112-1201号</a><span
                            style="margin: 0 6px;color: #ccc;">|</span><span
                            style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">违法和不良信息举报电话：4006561155</span>
                </p>
                <p><span class="copyright_text"
                         style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">Copyright © 2004 - <em
                        id="copyright_year"
                        style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">2022</em>  京东JD.com 版权所有</span><span
                        style="margin: 0 6px;color: #ccc;">|</span><span
                        style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">消费者维权热线：4006067733</span>
                    <a href="//pro.jd.com/mall/active/38PitHBfR7ZopNHRSHnuuWR5AMDL/index.html" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;"
                       class="copyright_license">经营证照</a>
                    <span style="margin: 0 6px;color: #ccc;">|</span>
                    <span style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">(京)网械平台备字(2018)第00003号</span>
                    <span style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//h5.m.jd.com/babelDiy/Zeus/ARcYnJ8coUdUecn6UQAN6TDaVmH/index.html" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;"
                       class="mod_business_license">营业执照</a>
                    <span style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="//h5.m.jd.com/pc/dev/3YxBvN6m5TsRyVCvDSeEh7awmLB4/index.html" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;"
                       rel="noopener noreferrer">增值电信业务经营许可证</a>
                </p>
                <p><span style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">京东旗下网站：</span>
                    <a href="https://www.jdpay.com/" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">京东钱包</a><span
                            style="margin: 0 6px;color: #ccc;">|</span>
                    <a href="https://www.jdcloud.com" target="_blank"
                       style="font-size: 12px;cursor: pointer;text-align: center;color: #666;text-decoration: none;">京东云</a>
                </p>
            </div>
        </div>
    </div>


</div>


</body>
<script type="text/javascript" th:inline="javascript">

    let uploadObj; // 上传凭证对象
    async function imgPreview() {
        let files = document.getElementById("input_file").files;

        if (files.length > 10) {
            alert("图片上传数量不得大于10");
            return false;
        }
        var resources = []; //上传之后的图片oss地址
        for (let j = 0; j < files.length; j++) {
            var uuid = getUUID();
            // 获取上传凭证
            await $.ajax({
                url: 'http://www.drygoods.top/api/thirdParty/oss/policy', // 这里是请求的后台通过oss上传凭证的接口
                data: JSON.stringify({
                    data: ''
                }),
                async: true, //发送同步请求
                dataType: 'json',
                type: 'post',
                headers: {
                    'Content-Type': 'application/json',
                },
                success: function (response) {
                    // alert("拿到令牌");
                    if (response) {
                        uploadObj = response.data;
                        // 获取到上传凭证成功之后 封装请求的数据
                        let request = new FormData();
                        request.append("OSSAccessKeyId", uploadObj.accessid); //Bucket 拥有者的Access Key Id。
                        request.append("policy", uploadObj.policy); //policy规定了请求的表单域的合法性
                        request.append("Signature", uploadObj.signature); //根据Access Key Secret和policy计算的签名信息，OSS验证该签名信息从而验证该Post请求的合法性
                        //---以上都是阿里的认证策略
                        var file = files[j];
                        if (!file) {
                            return;
                        }
                        // alert(file.name)

                        resources.push(uploadObj.host + "/" + uploadObj.dir + "/" + uuid + file.name);
                        request.append("key", `${uploadObj.dir}/${uuid}${file.name}`); //文件名字，可设置路径
                        request.append("success_action_status", '200'); // 让服务端返回200,不然，默认会返回204
                        request.append('file', file); //需要上传的文件 file
                        // console.log(resources, "111111")
                        $.ajax({
                            url: uploadObj.host, //上传阿里地址
                            data: request,
                            processData: false, //默认true，设置为 false，不需要进行序列化处理
                            cache: false, //设置为false将不会从浏览器缓存中加载请求信息
                            async: true, //发送同步请求
                            contentType: false, //避免服务器不能正常解析文件---------具体的可以查下这些参数的含义
                            dataType: 'json', //不涉及跨域  写json即可
                            type: 'post',
                            success: function (response) {
                                console.log(response, "123");
                            },
                            error: function (error) {
                                console.log(error, "error");
                            }
                        });
                        // alert(resources);
                    } else {
                        // alert(`${response && response.header.msg[0]}`);
                    }
                },
                error: function (error) {
                    console.log(error, "error");
                },
            });
        }
        // alert([[${spuComment.skuAttrs}]],1);
        console.log(resources, "2221111")
        await $.ajax({
            url: "http://comment.drygoods.top/save/commentInfo",
            data: JSON.stringify({
                'skuId': [[${spuComment.skuId}]],
                'spuId': [[${spuComment.spuId}]],
                'skuPic': [[${spuComment.skuPic}]],
                'spuName': [[${spuComment.spuName}]],
                'username': [[${spuComment.username}]],
                'star': document.getElementById("star").value,
                'showStatus': [[${spuComment.showStatus}]],
                'resources': resources.toString(),
                'skuAttrs': [[${spuComment.skuAttrs}]],
                'content': document.getElementById("content").value,
                'memberIcon': [[${spuComment.memberIcon}]],
                'commentType': document.getElementById("commentType").value,
                'orderSn': [[${spuComment.orderSn}]],
            }),
            processData: false, //默认true，设置为 false，不需要进行序列化处理
            cache: false, //设置为false将不会从浏览器缓存中加载请求信息
            async: true, //发送同步请求
            headers: {
                'Content-Type': 'application/json',
            },
            dataType: 'json', //不涉及跨域  写json即可
            type: 'post',
            success: function (response) {
                console.log(response, "response");
                alert("上传完毕")
                window.location.href = response.data;
            },
            error: function (error) {
                console.log(error, "error");
                console.log(error.responseJSON.message)
                document.getElementById("starMsg").innerText = error.responseJSON.message
                document.getElementById("starMsg").style.display = 'block'
                // window.location.href = error.responseJSON.message;

            }

        })
    }

    function search() {
        var keyword = $("#searchText").val()
        window.location.href = "http://search.drygoods.top/list.html?keyword=" + keyword;
    }

    //获取UUID
    function getUUID() {
        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
            var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
            return v.toString(16);
        });
    }

    // alert("UUID:" + getUUID());

</script>
<script type="text/javascript" src="/static/index/js/text.js"></script>
<script type="text/javascript" src="/static/index/js/header.js"></script>
<script type="text/javascript" src="/static/index/js/secend.js"></script>
<script type="text/javascript" src="/static/index/js/zz.js"></script>
<script type="text/javascript" src="/static/index/js/index.js"></script>
<script type="text/javascript" src="/static/index/js/left,top.js"></script>
<script type="text/javascript" src="/static/index/js/catalogLoader.js"></script>
</html>
